from django.db import models

# Create your models here.
#用户表
class Users(models.Model):
    m = '0'
    w = '1'

    username = models.CharField(max_length=32)
    weight = models.IntegerField()
    height = models.IntegerField()
    sex = models.CharField(max_length=1,choices=((m,'男'),(w,'女')),default=m)
    age = models.IntegerField()

    class  Meta():
        db_table = 'Users'

    def __str__(self):

        return self.username

#三级联动的模型
class Citys(models.Model):
    name = models.CharField(max_length=30)
    level = models.IntegerField()
    upid = models.IntegerField()

    class  Meta():
        db_table = 'citys'

    def __str__(self):

        return self.name